


#对于str类型  str[n] = str[n:n+1]
str1 = 'sjffsjdfs'
print(str1[0])
print(str1[0:1])
#对于别的类型  s[i] 返回一个元素，而 s[i:i+1] 返回一个相同类型的序列，里面是 s[i] 元素。
cafe = bytes('café', encoding='utf_8')
print(cafe)
print(cafe[0])
print(cafe[0:1])

list1 = [1,3,5,7,9]
print(type(list1[0]))
print(type(list1[0:1]))
print(list1[0:1])
aaa = b'98sf\xc3\xa9'
print(aaa.decode('UTF-8'))


for codec in ['latin_1', 'utf_8', 'utf_16']:
    print(codec, 'El Niño'.encode(codec), sep='\t')

a = '\xff\xfee'
for i in a:
    print(i)

print('-----分割线------')
# b = '\uff\ufe'
# for j in b:
#     print(j)

print(ord('ஷ'))
print(chr(2999))

c = bytes.fromhex('3A7FCC23753821')
print(c)
# cc = c.decode('utf8')
# print(cc)
